<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2008 XBRL International. All Rights Reserved. -->
<?xml-stylesheet type="text/xsl" href="../stylesheets/conformanceFunction.xsl"?>
<testcase
  xmlns="http://xbrl.org/2008/conformance"
  xmlns:reg="http://xbrl.org/2008/registry"
  xmlns:fcn="http://xbrl.org/2008/function"
  xmlns:cfcn="http://xbrl.org/2008/conformance/function"
  xmlns:xbrli="http://www.xbrl.org/2003/instance"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xfi="http://www.xbrl.org/2008/function/instance"
  xmlns:xfie="http://www.xbrl.org/2008/function/instance/error"
  xmlns:xqt-err="http://www.w3.org/2005/xqt-errors"
  xmlns:t="http://xbrl.org/formula/conformance/example" 
  xmlns:xlink="http://www.w3.org/1999/xlink"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="
  http://xbrl.org/2008/registry ../schemas/registry.xsd
  http://xbrl.org/2008/function ../schemas/function.xsd
  http://xbrl.org/2008/conformance ../schemas/conformance.xsd
  http://xbrl.org/2008/conformance/function ../schemas/conformanceFunction.xsd
  ">
  <owners>
    <reg:owner id="herm">
      <reg:name>Herm Fischer</reg:name>
      <reg:affiliation>UBMatrix / Mark V Systems</reg:affiliation>
      <reg:email>fischer@markv.com</reg:email>
     <reg:assumedOwnership moment="2008-02-06T12:55:00" />
    </reg:owner>
  </owners>

  <number>90301</number>

  <name>xfi:fact-explicit-scenario-dimension-value</name>

  <documentation>
  </documentation>

  <reference
    xlink:type="simple"
    xlink:href="90301 xfi.fact-explicit-scenario-dimension-value function.xml">
    function definition
  </reference>

  <variation id="V-01">
    <name>Location dimension for Mount Kilimanjaro</name>
    <documentation>
      <xhtml:p>
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema xlink:type="simple" xlink:href="fact-explicit-dimension-value.xsd"/>
      <linkbase xlink:type="simple" xlink:href="fact-explicit-dimension-value-definition.xml"/>
      <instance readMeFirst="true" id="V01" xlink:type="simple" xlink:href="fact-explicit-dimension-value-instance1.xml"/>
      <cfcn:call file="V01">
        xfi:fact-explicit-scenario-dimension-value(
          /xbrli:xbrl/t:Peak[./text() eq 'Mount Kilimanjaro'], 
          QName('http://xbrl.org/formula/conformance/example','t:Location')
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         $result instance of xs:QName? and
         count( $result ) eq 1 and
         $result eq QName('http://xbrl.org/formula/conformance/example','t:Tanzania')
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-01a">
    <name>Location default dimension for Vinson Massif</name>
    <documentation>
      <xhtml:p>
         Mt Vinson uses the Antarctica default dimension, so although it is not physically reported in the context, it is virtually reported due to the default for the dimension.
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema xlink:type="simple" xlink:href="fact-explicit-dimension-value.xsd"/>
      <linkbase xlink:type="simple" xlink:href="fact-explicit-dimension-value-definition.xml"/>
      <instance readMeFirst="true" id="V01a" xlink:type="simple" xlink:href="fact-explicit-dimension-value-instance1.xml"/>
      <cfcn:call file="V01a">
        xfi:fact-explicit-scenario-dimension-value(
          /xbrli:xbrl/t:Peak[./text() eq 'Vinson Massif'], 
          QName('http://xbrl.org/formula/conformance/example','t:Location')
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         $result instance of xs:QName? and
         count( $result ) eq 1 and
         $result eq QName('http://xbrl.org/formula/conformance/example','t:Antarctica')
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-02">
   <name>Location dimension for Peak concept Aurora Borealis (whose context lacks the location dimension)</name>
    <documentation>
      <xhtml:p>
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema xlink:type="simple" xlink:href="fact-explicit-dimension-value.xsd"/>
      <linkbase xlink:type="simple" xlink:href="fact-explicit-dimension-value-definition.xml"/>
      <instance readMeFirst="true" id="V02" xlink:type="simple" xlink:href="fact-explicit-dimension-value-instance1.xml"/>
      <cfcn:call file="V02">
        xfi:fact-explicit-scenario-dimension-value(
          /xbrli:xbrl/t:Peak[./text() eq 'Aurora Borealis'], 
          QName('http://xbrl.org/formula/conformance/example','t:Location')
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         $result instance of xs:QName? and
         count( $result ) eq 1 and
         $result eq QName('http://xbrl.org/formula/conformance/example','t:Antarctica')
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-03">
   <name>Location dimension for AtmosphericPhenomenon concept Aurora Borealis (whose hypercube lacks the location dimension)</name>
    <documentation>
      <xhtml:p>
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema xlink:type="simple" xlink:href="fact-explicit-dimension-value.xsd"/>
      <linkbase xlink:type="simple" xlink:href="fact-explicit-dimension-value-definition.xml"/>
      <instance readMeFirst="true" id="V03" xlink:type="simple" xlink:href="fact-explicit-dimension-value-instance1.xml"/>
      <cfcn:call file="V03">
        xfi:fact-explicit-scenario-dimension-value(
          /xbrli:xbrl/t:AtmosphericPhenomenon[./text() eq 'Aurora Borealis'], 
          QName('http://xbrl.org/formula/conformance/example','t:Location')
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         empty( $result )
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-04">
    <name>Error of concept argument which is not a dimension</name>
    <documentation>
      <xhtml:p>
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema xlink:type="simple" xlink:href="fact-explicit-dimension-value.xsd"/>
      <linkbase xlink:type="simple" xlink:href="fact-explicit-dimension-value-definition.xml"/>
      <instance readMeFirst="true" id="V04" xlink:type="simple" xlink:href="fact-explicit-dimension-value-instance1.xml"/>
      <cfcn:call file="V04">
        xfi:fact-explicit-scenario-dimension-value(
          /xbrli:xbrl/t:Peak[./text() eq 'Mount Everest'], 
          QName('http://xbrl.org/formula/conformance/example','t:Mars')
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <error>xfie:invalidExplicitDimensionQName</error>
    </outputs>
  </variation>

  <variation id="V-05">
    <name>Error of non-XBRL element argument as dimension argument</name>
    <documentation>
      <xhtml:p>
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema xlink:type="simple" xlink:href="fact-explicit-dimension-value.xsd"/>
      <linkbase xlink:type="simple" xlink:href="fact-explicit-dimension-value-definition.xml"/>
      <instance readMeFirst="true" id="V05" xlink:type="simple" xlink:href="fact-explicit-dimension-value-instance1.xml"/>
      <cfcn:call file="V05">
        xfi:fact-explicit-scenario-dimension-value(
          /xbrli:xbrl/t:Peak[./text() eq 'Mount Everest'], 
          QName('http://xbrl.org/formula/conformance/example','t:nonXbrlElement')
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <error>xfie:invalidExplicitDimensionQName</error>
    </outputs>
  </variation>

  <variation id="V-06">
    <name>Raises an error for an attribute declaration argument</name>
    <documentation>
      <xhtml:p>
        Tests that error is detected when the concept name argument declares an attribute.
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema xlink:type="simple" xlink:href="fact-explicit-dimension-value.xsd"/>
      <linkbase xlink:type="simple" xlink:href="fact-explicit-dimension-value-definition.xml"/>
      <instance readMeFirst="true" id="V06" xlink:type="simple" xlink:href="fact-explicit-dimension-value-instance1.xml"/>
      <cfcn:call file="V06">
        xfi:fact-explicit-scenario-dimension-value(
          /xbrli:xbrl/t:Peak[./text() eq 'Mount Everest'], 
          QName('http://xbrl.org/formula/conformance/example','t:anAttribute')
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <error>xfie:invalidExplicitDimensionQName</error>
    </outputs>
  </variation>

  <variation id="V-07">
    <name>Raises an error for an xbrli namespace&apos;ed argument</name>
    <documentation>
      <xhtml:p>
        Tests that error is detected when the concept qname is xbrli:item
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema xlink:type="simple" xlink:href="fact-explicit-dimension-value.xsd"/>
      <linkbase xlink:type="simple" xlink:href="fact-explicit-dimension-value-definition.xml"/>
      <instance readMeFirst="true" id="V07" xlink:type="simple" xlink:href="fact-explicit-dimension-value-instance1.xml"/>
      <cfcn:call file="V07">
        xfi:fact-explicit-scenario-dimension-value(
          /xbrli:xbrl/t:Peak[./text() eq 'Mount Everest'], 
          QName('http://xbrl.org/formula/conformance/example','xbrli:item')
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <error>xfie:invalidExplicitDimensionQName</error>
    </outputs>
  </variation>

  <variation id="V-08">
   <name>Dimension can be located in either segment or scenario, for this variation appears in the segment, to test that function is looking in only desired location for value.</name>
    <documentation>
      <xhtml:p>
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema xlink:type="simple" xlink:href="bi-locational-dim-concepts.xsd"/>
      <linkbase xlink:type="simple" xlink:href="bi-locational-dim-definition.xml"/>
      <instance readMeFirst="true" id="V08" xlink:type="simple" xlink:href="bi-locational-seg-explicit-instance.xml"/>
      <cfcn:call file="V08">
        xfi:fact-explicit-scenario-dimension-value(
          /xbrli:xbrl/t:PriItem1[1], 
          QName('http://xbrl.org/formula/conformance/example','t:ExplDim1')
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         empty( $result )
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-09">
   <name>Dimension can be located in either segment or scenario but for this variation appears in the scenario instead of segment, to test that function is looking in only desired location for value.</name>
    <documentation>
      <xhtml:p>
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema xlink:type="simple" xlink:href="bi-locational-dim-concepts.xsd"/>
      <linkbase xlink:type="simple" xlink:href="bi-locational-dim-definition.xml"/>
      <instance readMeFirst="true" id="V09" xlink:type="simple" xlink:href="bi-locational-scen-explicit-instance.xml"/>
      <cfcn:call file="V09">
        xfi:fact-explicit-scenario-dimension-value(
          /xbrli:xbrl/t:PriItem1[1], 
          QName('http://xbrl.org/formula/conformance/example','t:ExplDim1')
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         $result instance of xs:QName? and
         count( $result ) eq 1 and
         $result eq QName('http://xbrl.org/formula/conformance/example','t:ExplDim1Mbr1')
      </cfcn:test>
    </outputs>
  </variation>

  <revisions>
    <reg:revision on="2008-02-06T12:55:00" by="herm">
      <xhtml:p>
        Created the test case.
      </xhtml:p>
    </reg:revision>
    <reg:revision on="2008-03-16T08:30:00" by="herm">
      <xhtml:p>
        Added variations for bi-locational dimension with value in desired and opposite locations.
      </xhtml:p>
    </reg:revision>
    <reg:revision on="2008-05-22T08:30:00" by="herm">
      <xhtml:p>
        Added variation v-01a for default dimension value.
      </xhtml:p>
    </reg:revision>
    <reg:revision on="2008-11-16T08:30:00" by="herm">
      <xhtml:p>
        V-03 result changed to empty($result)
      </xhtml:p>
    </reg:revision>
  </revisions>

</testcase>
